<template>
  <div class="invite-item">
    <div>
      <div class="invite-item-top line1 pointer" @click.stop="details(item)">
        {{ source.resumeTitle }}
        <!-- 真诚求职一份工作真诚求职一份工作真诚求职一份工作标题（标题三十五个字） -->
      </div>
      <div class="invite-item-middle">
        <span
          v-for="(item, index) in (source.intendedPosition || '')
            .split('|')
            .filter(item => item)"
          :key="item + index"
        >
          {{ item }}</span
        >
        <!-- <span>电子数据取证分析师</span>
        <span>办公室文员</span>
        <span>服务机器人应用技术人员</span>
        <span>保洁员</span> -->
      </div>
    </div>

    <div class="invite-item-bottom">
      <img
        @click.stop="agentDetailNew(source)"
        :src="source.userInformation.image || defaultAvatar"
        alt=""
      />
      <div @click.stop="agentDetailNew(source)" class="invite-name">
        <!-- 王依依 -->
        {{
          source.userInformation.nikeName
            ? source.userInformation.nikeName
            : "未命名用户"
        }}
      </div>
      <div
        class="invite-vip"
        style="flex-shrink:0"
        :style="{
          color:
            colors[(source.userInformation.memberLevel || 1) - 1].wordColor,
          backgroundColor:
            colors[(source.userInformation.memberLevel || 1) - 1].bgColor,
          borderColor:
            colors[(source.userInformation.memberLevel || 1) - 1].lineColor
        }"
      >
        <!-- 青铜会员 -->
        {{ source.memberTitle }}
      </div>
      <div class="marks">
        {{ source.experienceYears }}工作经验
        <div class="marks-seperate"></div>
      </div>
      <div class="marks">
        <!-- 大专 -->
        {{ source.highestEducation }}
        <div class="marks-seperate"></div>
      </div>
      <div class="marks gray" v-if="item.homeAddress">
        <!-- 白沙河 -->
        {{ source.homeAddress }}
        <div class="marks-seperate"></div>
      </div>
      <div class="marks gray" v-if="item.distance">
        <!-- 3.9km -->
        {{ source.distance }}km

        <div class="marks-seperate"></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    source: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  data() {
    return {
      item: {},
      colors: [
        {
          bgColor: "#E9EFEF",
          wordColor: "#60807D",
          lineColor: "#B6C4C3",
          level: "青铜会员"
        },
        {
          bgColor: "#F7F7F7",
          wordColor: "#A3AAB0",
          lineColor: "#D2D9E0",
          level: "白银会员"
        },
        {
          bgColor: "#FFF8DE",
          wordColor: "#CEAB21",
          lineColor: "#D3CAB2",
          level: "黄金会员"
        },
        {
          bgColor: "#EDFAFF",
          wordColor: "#59B0E6",
          lineColor: "#BBD0DB",
          level: "铂金会员"
        },
        {
          bgColor: "#F2F5FF",
          wordColor: "#284EB6",
          lineColor: "#C1CBEF",
          level: "钻石会员"
        },
        {
          bgColor: "#FDF7FF",
          wordColor: "#A877C6",
          lineColor: "#DBC6E8",
          level: "钻石Ⅰ会员"
        },
        {
          bgColor: "#F8F2FF",
          wordColor: "#78439F",
          lineColor: "#958AC3",
          level: "钻石Ⅱ会员"
        },
        {
          bgColor: "#F4F2F2",
          wordColor: "#8D4581",
          lineColor: "#907B8C",
          level: "钻石Ⅲ会员"
        },
        {
          bgColor: "#F4F2F2",
          wordColor: "#502E30",
          lineColor: "#795D5E",
          level: "王者会员"
        }
      ]
    };
  },
  methods: {
    details() {
      this.goResumeOne(
        {
          id: this.source.id
        },
        this.source
      );
    }
  }
};
</script>

<style lang="less" scoped>
.invite-item {
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  max-width: 1200px;
  opacity: 1;
  border-bottom: 1px solid #f2f2f2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  // padding: 16px 0;
  height: 126px;
  div {
    .invite-item-top {
      height: 34px;
      font-size: 22px;
      font-weight: 500;
      color: #333333;
      line-height: 34px;
      margin-bottom: 10px;
    }
    .invite-item-middle {
      height: 28px;
      font-size: 18px;
      font-weight: 400;
      color: #333333;
      line-height: 28px;
      span {
        margin-right: 20px;
      }
    }
  }
  .invite-item-bottom {
    display: flex;
    align-items: center;
    margin-top: 6px;
    img {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: #d9d9d9;
      opacity: 1;
      margin-right: 4px;
    }
    .invite-name {
      font-size: 18px;
      font-weight: 400;
      color: #333333;
      margin-right: 4px;
      cursor: pointer;
    }
    .invite-vip {
      padding: 0 3px;
      margin-right: 20px;
      white-space: nowrap;
      font-size: 16px;
    }
    .marks {
      white-space: nowrap;
      font-size: 16px;
      font-weight: 400;
      color: #333333;
      display: flex;
      align-items: center;
      justify-content: center;
      &:last-child {
        .marks-seperate {
          display: none;
        }
      }
      &.gray {
        color: #999999;
      }

      .marks-seperate {
        width: 2px;
        height: 25px;
        opacity: 1;
        background-color: #999999;
        margin: 0 6px;
      }
    }
  }
}
</style>
